import { ref } from 'vue'
import pageContent from '@/base-ui/page-content'
export function usePageSeach(): any {
  const pageContentRef = ref<InstanceType<typeof pageContent>>()
  function handlerClick(payload: any) {
    const { type, formData } = payload
    switch (type) {
      case '重置':
        pageContentRef.value?.getPageData()
        break
      case '搜索':
        pageContentRef.value?.getPageData(formData.value)
        break
    }
  }
  return [pageContentRef, handlerClick]
}
